﻿<UserControl x:Class="ViewDashboardDataBinding"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:system="clr-namespace:System;assembly=mscorlib"              
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="490">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
    
       
    <Grid Grid.Row="1">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="5"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="5"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="5" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>


        <ListBox Grid.RowSpan="3" ItemsSource="{Binding DataSourceList}" SelectedItem="{Binding Mode=TwoWay, Path=DataSource}" DisplayMemberPath="Name" IsSynchronizedWithCurrentItem="True" />

        <GroupBox Grid.Column="2" Grid.RowSpan="3" Header="Variable Calculee" Padding="5" >
            <DockPanel   >
                <ComboBox DockPanel.Dock="Top" Background="White" Margin="0,0,0,5"  SelectedItem="{Binding Mode=TwoWay, Path=Aggregate}">
                    <ComboBox.ItemsSource>
                        <x:Array Type="{x:Type system:String}">
                            <system:String>(Aucun)</system:String>
                            <system:String>Somme</system:String>
                            <system:String>Moyenne</system:String>
                            <system:String>Minimum</system:String>
                            <system:String>Maximum</system:String>
                            <system:String>Variance</system:String>
                            <system:String>Ecart-Type</system:String>
                            <system:String>Nombre</system:String>
                            <system:String>Nombre Distinct</system:String>
                            <system:String>Distinct</system:String>
                        </x:Array>
                    </ComboBox.ItemsSource>
                </ComboBox>
                <ListBox SelectionMode="Single"   SelectedItem="{Binding Mode=TwoWay, Path=DataMember}"  ItemsSource="{Binding Path=DataSourceList/Columns}" DisplayMemberPath="Name"/>

            </DockPanel>
        </GroupBox>

        <GroupBox  Grid.Column="4" Grid.Row="2" Header="Variable Segmentant" Padding="5" >
            <DockPanel  >
                <ComboBox DockPanel.Dock="Top" Background="White" Margin="0,0,0,5"  SelectedItem="{Binding Mode=TwoWay, Path=DimensionSorting}">
                    <ComboBox.ItemsSource>
                        <x:Array Type="{x:Type system:String}">
                            <system:String>(Aucun)</system:String>
                            <system:String>Valeurs Croissantes</system:String>
                            <system:String>Valeurs Decroissantes</system:String>
                            <system:String>Libelles Croissants</system:String>
                            <system:String>Libelles Deroissants</system:String>
                            <system:String>Poids Croissants</system:String>
                            <system:String>Poids Deroissants</system:String>
                        </x:Array>
                    </ComboBox.ItemsSource>
                </ComboBox>
                <ListBox SelectionMode="Single"   SelectedItem="{Binding Mode=TwoWay, Path=DimensionDataMember}"  ItemsSource="{Binding Path=DataSourceList/Columns}" DisplayMemberPath="Name"/>

            </DockPanel>
        </GroupBox>


        <GroupBox  Grid.Column="4" Grid.Row="0" Header="Variable Poids" Padding="5" >
            <DockPanel  >
                <ComboBox DockPanel.Dock="Top" Background="White" Margin="0,0,0,5"  SelectedItem="{Binding Mode=TwoWay, Path=WeightSorting}">
                    <ComboBox.ItemsSource>
                        <x:Array Type="{x:Type system:String}">
                            <system:String>(Aucun)</system:String>
                            <system:String>Cumule</system:String>
                            <system:String>Non Cumule</system:String>                            
                        </x:Array>
                    </ComboBox.ItemsSource>
                </ComboBox>
                <ListBox SelectionMode="Single"   SelectedItem="{Binding Mode=TwoWay, Path=WeightDataMember}"  ItemsSource="{Binding Path=DataSourceList/Columns}" DisplayMemberPath="Name"/>

            </DockPanel>
        </GroupBox>
        <UniformGrid Grid.Row="3" Columns="2" Grid.ColumnSpan="3">
            <RadioButton Content="Statique" Margin="5" HorizontalAlignment="Center"/>
            <RadioButton Content="Dynamique" Margin="5" HorizontalAlignment="Center"/>
        </UniformGrid>
        </Grid>
    </Grid>
</UserControl>
